<template>
  <router-view/>
</template>
<script setup>
	import { watch } from "vue"
	import { useRouter } from 'vue-router'
	import store from "./store";
	
	const router = useRouter()
	
	watch(() => router.currentRoute.value,(toPath) => {
					
					if(toPath.path!=='/'&&'/Login'){
						let obj={
							name:toPath.name,
							title:toPath.meta.title
						}
						
						store.commit('addtab',obj)
					}
			  
			     },{immediate: true,deep: true})
	watch(() => store.state.menus.editableTabs,(val) => {
					val.forEach((item,index)=>{
						if(item.name=='Login'){
							val.splice(index,1)
						}
						if(item.name==''){
							val.splice(index,1)
						}
					})
					
			     },{immediate: true,deep: true})
</script>
<style>
	html,body{
		margin: 0; 
		padding: 0;
		border: 0;
		height: 100%;
	}
	
</style>
